{include file="public/header" /}

<body style="background-color: #ffffff">
    <div class="layui-fluid">
        <div class="layui-row">
            <form class="layui-form">
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>设置名称</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input" value="{$row.name|default=''}"
                            disabled>
                    </div>
                </div>
                {if $row.key_value == 'plathandfee'}
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>提币阶段</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input"
                            value="{$row.value.coinnum|default=''}" name="value[coinnum]">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>手续费阶段</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input"
                            value="{$row.value.coinhandfee|default=''}" name="value[coinhandfee]">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <div class="layui-form-mid layui-word-aux">
                            提示：提币阶段如果是100-500,500-1000,1000-2000，提币阶段填写100,500,1000,2000即可，中间用英文','分割，手续费阶段如果是按峰值的10%计算，则填写10,50,100,200即可
                        </div>
                    </div>
                </div>
                {elseif $row.key_value == 'platformswitch'}
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>开关</label>
                    <div class="layui-input-inline">
                        <select name="value" lay-verify="required">
                            <option value="1" {if !empty($row.value) && $row.value==1}selected{/if}>开</option>
                            <option value="2" {if !empty($row.value) && $row.value==2}selected{/if}>关</option>
                        </select>
                    </div>
                </div>
                {elseif $row.key_value == 'lockrateInterval'}
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>锁仓阶段</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input" value="{$row.value.money|default=''}"
                            name="value[money]">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>锁仓阶段释放比率</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input" value="{$row.value.rate|default=''}"
                            name="value[rate]">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <div class="layui-form-mid layui-word-aux">
                            提示：锁仓阶段如果是0-1000,1000-2000,2000以上，锁仓阶段填写0,1000,2000即可，中间用英文','分割
                        </div>
                    </div>
                </div>
                {elseif $row.key_value == 'ethotherhandfee' || $row.key_value == 'btcotherhandfee' || $row.key_value ==
                'otherhandfee' || $row.key_value == 'jsrhandfee'}
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>起提数量</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input"
                            value="{$row.value.coinnum|default='0'}" name="value[coinnum]">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>手续费比例（单位：%）</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input"
                            value="{$row.value.coinhandfee|default='0'}" name="value[coinhandfee]">
                    </div>
                </div>
                {elseif $row.key_value == 'Android' || $row.key_value == 'ios' || $row.key_value == 'register_url' ||
                $row.key_value == 'version'}
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>设置值</label>
                    <div class="layui-input-inline">
                        <input type="text" autocomplete="off" class="layui-input" value="{$row.value|default=''}"
                            name="value">
                    </div>
                </div>
                {else}
                <div class="layui-form-item">
                    <label for="L_choose_name" class="layui-form-label">
                        <span class="x-red">*</span>设置值</label>
                    <div class="layui-input-inline">
                        <input type="number" autocomplete="off" class="layui-input" value="{$row.value|default=''}"
                            name="value">
                    </div>
                </div>
                {/if}

                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <input type="hidden" value="{$row.id|default=''}" name="id">
                    <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <button type="button" class="layui-btn layui-btn-primary" onclick="IframeClose()">取消</button>

                </div>
            </form>
        </div>
    </div>
    {include file="public/footer" /}
    <script src="/static/leyedit/Layui-KnifeZ/layui.js"></script>
    <script src="/static/leyedit/ace/ace.js"></script>
    <script>
        layui.use('upload', function () {
            var $ = layui.jquery
                , upload = layui.upload;
            //图片上传
            var uploadInst = upload.render({
                elem: '#test1'
                , url: '/Base/upload_img'
                , accept: 'images'
                , before: function (obj) {
                    //预读本地文件示例，不支持ie8
                    obj.preview(function (index, file, result) {
                        $('#demo1').attr('src', result); //图片链接（base64）
                    });
                }
                , done: function (res) {
                    //如果上传失败
                    if (res.code > 0) {
                        return layer.msg('上传失败');
                    }
                    //上传成功
                    $('#cover').val(res.data.src);
                }
                , error: function () {
                    //演示失败状态，并实现重传
                    var demoText = $('#demoText');
                    demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                    demoText.find('.demo-reload').on('click', function () {
                        uploadInst.upload();
                    });
                }
            });
        });
        layui.use(['layedit', 'layer', 'jquery', 'form'], function () {
            $ = layui.jquery;
            var form = layui.form
                , layer = layui.layer;
            //监听提交
            form.on('submit(add)', function (data) {
                //发异步，把数据提交给php
                $.ajax({
                    'type': 'post',
                    data: data.field,
                    success: function (res) {
                        if (res.status == 0) {
                            layer.msg(res.msg, { icon: 6, time: 1000 }, function () {
                                // 获得frame索引
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.location.reload();
                                parent.layer.close(index);
                            });
                        } else {
                            layer.msg(res.msg, { icon: 2, time: 1000 });
                        }
                    }
                });
                return false;
            });
        });
    </script>

</body>

</html>